package com.tyl.xtk.beans.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyl.xtk.config.validation.groups.Insert;
import com.tyl.xtk.config.validation.groups.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.InputStream;
import java.time.LocalDateTime;

/**
 * 文件信息实体类
 */
@EqualsAndHashCode(callSuper = true)
@TableName("file_info")
@Data
@Schema(description = "文件信息")
public class FileInfo extends Record {

    @NotNull(groups = Update.class, message = "文件ID不能为空")
    @Schema(description = "文件ID")
    private Long id;

    @Schema(description = "文件名")
    private String name;

    @Schema(description = "文件内容类型")
    private String contentType;

    @TableField(exist = false)
    @Schema(description = "文件输入流")
    private InputStream inputStream;

    @Schema(description = "文件路径")
    private String filePath;

    @Schema(description = "是否已删除")
    @TableLogic
    private Boolean deleted = false;
}